/* 
 * File:   AngularAngularUnaryOperator.h
 * Author: Gab'z
 *
 * Created on 6 juin 2012, 02:57
 */

#ifndef ANGULARUNARYOPERATOR_H
#define	ANGULARUNARYOPERATOR_H

#include "../Operator.h"
#include "../../literal/Number.h"

namespace calculator {
    const double PI = 4 * std::atan(1);

    class SimpleNumber;

    class AngularUnaryOperator : public Operator {
    public:
        std::string isExecutable() const;
        virtual AngularUnaryOperator* clone() const = 0;

        const Memento* createMemento() const throw (CommandException);

    protected:
        virtual const Number* apply(const SimpleNumber* number) const throw (ArithmeticException) = 0;

        const Number * apply(const Number * number) const throw (ArithmeticException);
        AngularUnaryOperator(const std::string name);
        virtual ~AngularUnaryOperator();
    private:
        void eval(Stack * stack) const throw (CommandException);
        AngularUnaryOperator(const AngularUnaryOperator & orig);
    };
}

#endif	/* ANGULARUNARYOPERATOR_H */

